<template>
  <div id="app">
    <TestDataEntryView :config="config" />
    <SettingView /> 
    <!-- <TemplateManagerPage /> -->
    <ProjectConfigPage />
    <!-- <AutoTemplateDemo /> -->
    <!-- <ExcelUpload />
    <TemplateCanvas :parseResult="parseResult" :templateId="templateId" /> -->
    <!-- <ExcelImportDemo :paramConfig="config" /> -->
  </div>
</template>

<script>
import SettingView from '@/views/setting.vue'
import TestDataEntryView from '@/views/testEntry.vue'
// import TemplateManagerPage from '@/views/TemplateManagerPage.vue'
import ProjectConfigPage from '@/views/ProjectConfigPage.vue'
// import TemplateCanvas from '@/components/template-canvas/TemplateCanvas.vue'
// import ExcelUpload from '@/components/excel-upload/ExcelUpload.vue'
// import { mockExcelParseResult } from '@/mock/excelParseResult';
// import ExcelImportDemo from '@/views/ExcelImportDemo.vue'

export default {
  components: {
    TestDataEntryView,
    SettingView,
    // TemplateManagerPage,
    ProjectConfigPage
    // AutoTemplateDemo,
    // TemplateCanvas,
    // ExcelUpload
    // ExcelImportDemo,
  },
  data() {
    return {
      // parseResult: mockExcelParseResult,
      // templateId: 'TPL_TEST_001', // 手动指定模板ID
        config: {
  "projectId": "PROJ558276641",
  "projectName": "土工击实试验记录(最大干密度、最佳含水率)",
  "standardCode": "GB/T 220.1-2021",
  "description": "土工击实试验记录(最大干密度、最佳含水率)",
  "paramGroups": [
    {
      "groupId": "GRP4PKeyS",
      "groupName": "基本数据",
      "isNested": false,
      "allowDynamicRows": false,
      "maxRows": 3,
      "sortOrder": 1,
      "childGroups": [],
      "paramItems": [
        {
          "paramId": "PARAMjzUtcvSu",
          "paramName": "筒  号",
          "paramCode": "yhr55p",
          "dataType": "text",
          "paramType": "base",
          "unit": "",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 1
        },
        {
          "paramId": "PARAMAB3V9YQd",
          "paramName": "筒容积",
          "paramCode": "yh62t9",
          "dataType": "number",
          "paramType": "base",
          "unit": "mm²",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 2
        },
        {
          "paramId": "PARAM3Y84Bxof",
          "paramName": "击实方法",
          "paramCode": "yhgs81",
          "dataType": "text",
          "paramType": "base",
          "unit": "",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 3
        },
        {
          "paramId": "PARAMlbRO1GaY",
          "paramName": "击锤质量",
          "paramCode": "yhelqy",
          "dataType": "number",
          "paramType": "base",
          "unit": "kg",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 4
        },
        {
          "paramId": "PARAMkUO1BnWN",
          "paramName": "落距",
          "paramCode": "yh7gh0",
          "dataType": "number",
          "paramType": "base",
          "unit": "mm",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 5
        },
        {
          "paramId": "PARAMuc39vlK1",
          "paramName": "击实层数",
          "paramCode": "yh53yh",
          "dataType": "number",
          "paramType": "base",
          "unit": "",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 6
        },
        {
          "paramId": "PARAMalfHx25f",
          "paramName": "击实次数",
          "paramCode": "yh1vyh",
          "dataType": "number",
          "paramType": "base",
          "unit": "",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 7
        }
      ]
    },
    {
      "groupId": "GRPAErZzl",
      "groupName": "密    度",
      "isNested": false,
      "allowDynamicRows": false,
      "maxRows": 3,
      "sortOrder": 2,
      "childGroups": [],
      "paramItems": [
        {
          "paramId": "PARAM6p8GSV10",
          "paramName": "预计含水率",
          "paramCode": "yhyhv4",
          "dataType": "number",
          "paramType": "base",
          "unit": "%",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 5,
          "sortOrder": 8
        },
        {
          "paramId": "PARAMMFz4bezM",
          "paramName": "筒+湿试样质量",
          "paramCode": "yh7ena",
          "dataType": "number",
          "paramType": "base",
          "unit": "g",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 5,
          "sortOrder": 9
        },
        {
          "paramId": "PARAM62WFeSti",
          "paramName": "筒  质  量",
          "paramCode": "yhy2uk",
          "dataType": "number",
          "paramType": "base",
          "unit": "g",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 5,
          "sortOrder": 10
        },
        {
          "paramId": "PARAMpDsvyTN6",
          "paramName": "湿试样质量",
          "paramCode": "yh8hln",
          "dataType": "number",
          "paramType": "base",
          "unit": "g",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 5,
          "sortOrder": 11
        },
        {
          "paramId": "PARAMqOrELeqP",
          "paramName": "湿  密  度",
          "paramCode": "yhuicd",
          "dataType": "number",
          "paramType": "base",
          "unit": "kg/m³",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 5,
          "sortOrder": 12
        }
      ]
    },
    {
      "groupId": "GRPKjNZGP",
      "groupName": "含 水 率",
      "isNested": false,
      "allowDynamicRows": true,
      "maxRows": 5,
      "sortOrder": 3,
      "childGroups": [],
      "paramItems": [
        {
          "paramId": "PARAMFSddp3nL",
          "paramName": "盒      号",
          "paramCode": "yh32jh",
          "dataType": "text",
          "paramType": "base",
          "unit": "",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 200,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 2,
          "sortOrder": 1
        },
        {
          "paramId": "PARAMBByFrtvL",
          "paramName": "盒+湿试样质量",
          "paramCode": "yh2il0",
          "dataType": "number",
          "paramType": "base",
          "unit": "g",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 200,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 2,
          "sortOrder": 2
        },
        {
          "paramId": "PARAMSgpL6cV0",
          "paramName": "盒+干试样质量",
          "paramCode": "yhen00",
          "dataType": "text",
          "paramType": "base",
          "unit": "g",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 200,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 2,
          "sortOrder": 3
        },
        {
          "paramId": "PARAMP5JZasNY",
          "paramName": "盒  质  量",
          "paramCode": "yhape4",
          "dataType": "number",
          "paramType": "base",
          "unit": "g",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 200,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 2,
          "sortOrder": 4
        },
        {
          "paramId": "PARAMvqdi0BE7",
          "paramName": "水  质  量",
          "paramCode": "yhp0cd",
          "dataType": "number",
          "paramType": "base",
          "unit": "g",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 200,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 2,
          "sortOrder": 5
        },
        {
          "paramId": "PARAMt7Bw0GCQ",
          "paramName": "干试样质量",
          "paramCode": "yhyzln",
          "dataType": "number",
          "paramType": "base",
          "unit": "g",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 200,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 2,
          "sortOrder": 6
        },
        {
          "paramId": "PARAMuhwOLlPP",
          "paramName": "含  水  率",
          "paramCode": "yh1jpr",
          "dataType": "number",
          "paramType": "base",
          "unit": "%",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 200,
          "placeholder": "",
          "isMultiMeasure": true,
          "multiMeasureCount": 2,
          "sortOrder": 7
        },
        {
          "paramId": "PARAMscB5W5eJ",
          "paramName": "平均含水率",
          "paramCode": "yh85u3",
          "dataType": "number",
          "paramType": "base",
          "unit": "%",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 8
        },
        {
          "paramId": "PARAMwZElpJ8X",
          "paramName": "干  密  度",
          "paramCode": "yhoasq",
          "dataType": "number",
          "paramType": "base",
          "unit": "kg/m³",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 9
        }
      ]
    },
    {
      "groupId": "GRPVWTLfi",
      "groupName": "试验结果",
      "isNested": false,
      "allowDynamicRows": false,
      "maxRows": 3,
      "sortOrder": 4,
      "childGroups": [],
      "paramItems": [
        {
          "paramId": "PARAM2Egvjucb",
          "paramName": "最大干密度",
          "paramCode": "yhrywk",
          "dataType": "number",
          "paramType": "base",
          "unit": "kg/m³",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 1
        },
        {
          "paramId": "PARAMTSl8z2Hc",
          "paramName": "最佳含水率",
          "paramCode": "yhjo98",
          "dataType": "number",
          "paramType": "base",
          "unit": "kg/m³",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 2
        },
        {
          "paramId": "PARAMuPCx3nkM",
          "paramName": "记录说明",
          "paramCode": "yhx3b7",
          "dataType": "textarea",
          "paramType": "base",
          "unit": "",
          "required": false,
          "calculationExpr": "",
          "dependencies": [],
          "options": [],
          "validateRule": {},
          "conditionShow": {},
          "precision": 1,
          "columnWidth": 150,
          "placeholder": "",
          "isMultiMeasure": false,
          "multiMeasureCount": 1,
          "sortOrder": 3
        }
      ]
    }
  ]
}
      
    }
  },
  methods: {
        // 保存模板到后端
    handleSaveTemplate(templateData) {
      // 调用后端API提交模板JSON
      console.log('保存模板：', templateData);
      // 示例：this.$axios.post('/api/template/save', templateData);
    }
  }
}
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  padding: 20px;
  background-color: #f5f7fa;
  min-height: 100vh;
}
</style>